home *** CD-ROM | disk | FTP | other *** search
- /*==============================================================================
- Project: POV-Ray
-
- Version: 3
-
- File: AppPrefs.h
-
- Description: Application preferences dialog and handlers
- ------------------------------------------------------------------------------
- Author:
- Eduard [esp] Schwan
- ------------------------------------------------------------------------------
- from Persistence of Vision(tm) Ray Tracer
- Copyright 1996 Persistence of Vision Team
- ------------------------------------------------------------------------------
- NOTICE: This source code file is provided so that users may experiment
- with enhancements to POV-Ray and to port the software to platforms other
- than those supported by the POV-Ray Team. There are strict rules under
- which you are permitted to use this file. The rules are in the file
- named POVLEGAL.DOC which should be distributed with this file. If
- POVLEGAL.DOC is not available or for more info please contact the POV-Ray
- Team Coordinator by leaving a message in CompuServe's Graphics Developer's
- Forum. The latest version of POV-Ray may be found there as well.
-
- This program is based on the popular DKB raytracer version 2.12.
- DKBTrace was originally written by David K. Buck.
- DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
- ------------------------------------------------------------------------------
- Change History:
- 941230 [esp] Created
- 950629 [esp] Changed aPrf to APRF per registry with Apple
- ==============================================================================*/
-
- #ifndef APPPREFS_H
- #define APPPREFS_H
-
-
- /*==== Macintosh-specific headers ====*/
- #include "config.h"
-
- #include <types.h>
- #include <Files.h>
-
- #include "FilePrefs.h" // gDefltFilePrefs_h
- #include "povmac.h"
-
-
- // Dialog user item ID, used for default outline proc
- #define kDefaultOutlineItem 3
-
- // STR# Resource for File Names
- #define kSTRI_FileNames 1000
- #define kSTRIi_Prefs 1
- #define kSTRIi_Guide 2
- #define kSTRIi_Templates 3
- #define kSTRIi_INCLUDE_Def 4
- #define kSTRIi_POVRAY_INI 5
-
-
- /*==== preferences resource - Application ====*/
-
- // the resource ID of the preferences resource (POV-Ray v1.0=128, 2.0=200, 3.0=300)
- #define kAppPrefs_rsrcID 300
- // the resource type
- #define kAppPrefsRsrc 'APRF'
-
- // The version # of the prefs resources - increment this when prefs_rec_t's change.
- // This currently follows the app version #, so 8352 is version
- // 8 3 5 2
- // (beta) 3.0 release 5 Mac build 2
- // Final release will clear the high nybble (83XX will become 03XX)
-
- #define kAppPrefs_Vers kFilePrefs_Vers
-
- typedef enum // menu items
- {
- eThrottle_Lowest=1,
- eThrottle_Default=3,
- eThrottle_Highest=5
- };
-
- typedef enum // menu items
- {
- eDone_Quiet=1, // don't notify at all when done
- eDone_Beep,
- eDone_Dialog,
- eDone_BnD,
- eDone_Quit
- };
-
- typedef enum // menu items
- {
- eRender_Self=1,
- eRender_Search,
- eRender_UserChosen
- };
-
- // This resource/struct will be saved to disk, and should match
- // its 68K equivalent...
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
- typedef struct
- {
- UINT16_t prefsVersion; // prefs resource version #
- UINT16_t appThrottle; // how much CPU time POV-Ray should use
- UINT16_t autoLoadTemplates; // Auto-read templates on app startup
- UINT16_t whenBusy; // what to do if files dropped on while rendering
- UINT16_t allDoneSoundID; // sound resource ID to use when all done
- UINT16_t allDoneNotify; // what to do when last job is finished
- UINT16_t autoSavePict; // auto-save PICT when rendering completes
- // (IGNORED/ALWAYS done if multi-job or animation)
- UINT16_t useAppDefaultPrefs; // ignore file prefs and use app default prefs
- UINT16_t useTempMem; // use tempmem instead of app heap (always on for now)
- UINT16_t showSplashScreen; // show splash screen on startup
- UINT16_t addCustomIcons; // add custom Finder icons to PICT files when saved
- UINT16_t keepGoingOnErrors; // don't halt jobs on errors, continue next job
- Rect appPrefsDlgPos; // remember top/left corner of app prefs dialog
- Rect filePrefsDlgPos; // remember top/left corner of rendering prefs dialog
- FSSpec includeDirFSSpec; // search path directory ref (note that name is volname!)
- } app_prefs_rec_t, *app_prefs_ptr_t, **app_prefs_hdl_t;
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
-
- // ---------------------------------------------------------------------
-
- extern app_prefs_hdl_t gAppPrefs_h; // App prefs from prefs file
- extern file_prefs_hdl_t gDefltFilePrefs_h; // default file prefs from prefs file
- extern Boolean gUseAppDefaultPrefs; // True if overriding file prefs
-
-
- // ---------------------------------------------------------------------
-
- void APSet_TimeSlice(short newValue);
- short APGet_TimeSlice(void);
-
- void APSet_AutoTemplates(Boolean newValue);
- Boolean APGet_AutoTemplates(void);
-
- void APSet_AllDoneSoundID(short newValue);
- short APGet_AllDoneSoundID(void);
-
- void APSet_AutoSaveImage(Boolean newValue);
- Boolean APGet_AutoSaveImage(void);
-
- void APSet_AllDoneNotify(short newValue);
- short APGet_AllDoneNotify(void);
-
- void APSet_UseAppDefaultPrefs(Boolean newValue);
- Boolean APGet_UseAppDefaultPrefs(void);
-
- void APSet_UseTempMem(Boolean newValue);
- Boolean APGet_UseTempMem(void);
-
- void APSet_ShowSplashScreen(Boolean newValue);
- Boolean APGet_ShowSplashScreen(void);
-
- void APSet_ShutDownWhenDone(Boolean newValue);
- Boolean APGet_ShutDownWhenDone(void);
-
- void APSet_AddCustomIcons(Boolean newValue);
- Boolean APGet_AddCustomIcons(void);
-
- void APSet_KeepGoingOnErrors(Boolean newValue);
- Boolean APGet_KeepGoingOnErrors(void);
-
- void APSet_IncludePaths(FSSpecPtr newValue);
- FSSpecPtr APGet_IncludePaths(void);
-
- void APSet_AppPrefsDlgPos(Rect * r);
- void APGet_AppPrefsDlgPos(Rect * r);
-
- void APSet_FilePrefsDlgPos(Rect * r);
- void APGet_FilePrefsDlgPos(Rect * r);
-
- OSErr AppPrefs_Open(void);
- void AppPrefs_Close(void);
- void AppPrefs_Write(void);
- void AppPrefs_Read(void);
- void AppPrefs_Prompt_Init(void);
-
- #endif // APPPREFS_H
-